﻿namespace ManagedChangeJournal.Native.Journal
{
    using System;
    using System.Runtime.InteropServices;

    /// <summary>
    /// USN_JOURNAL_DATA structure
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    struct JournalData
    {
        /// <summary>
        /// 64-bit unique journal identifier.
        /// </summary>
        public ulong UsnJournalID;
        /// <summary>
        /// Identifies the first Usn in the journal. 
        /// All Usn's below this value have been purged.
        /// </summary>
        public long FirstUsn;
        /// <summary>
        /// The Usn that will be assigned to the next record appended to the journal.
        /// </summary>
        public long NextUsn;
        /// <summary>
        /// The lowest Usn that is valid for this journal and may be zero. 
        /// All changes with this Usn or higher have been recorded in the journal.
        /// </summary>
        public long LowestValidUsn;
        /// <summary>
        /// The largest Usn that will ever to assigned to a record in this journal.
        /// </summary>
        public long MaxixmumUsn;
        /// <summary>
        /// The maximum size, in bytes, the journal can use on the volume.
        /// </summary>
        public ulong MaximumSize;
        /// <summary>
        /// The size, in bytes, the journal can grow when needed, and 
        /// purge from the start of the journal is it grows past MaximumSize.
        /// </summary>
        public ulong AllocationDelta;
    }
}
